layui.use(['form', 'jquery', 'layer'], function (data) {
    var form = layui.form,
        $ = layui.jquery,
        layer = layui.layer;

    form.on('submit(addQualityResult)', function (data) {
        var formData = data.field;
        var index = layer.msg("数据提交中，请稍后", {
            icon: 16,
            time: false,
            shade: 0.8
        })
        $.ajax({
            data: formData,
            url: ctx + "/quality/addQualityResult",
            type: "post",
            success: function (data) {
                console.log(data)
                if (data.code == 200) {
                    layer.closeAll("iframe");
                    layer.msg(data.msg);
                    layer.close(index);
                    parent.location.reload();
                } else {
                    layer.closeAll("iframe");
                    layer.msg(data.msg)


                }
            },
            error: function (data) {
                layer.closeAll("iframe");
                layer.msg("error");
            }

        })
      return false ;

    })


})